///G. Hagopian
///left to right computation

#include "std_lib_facilities.h"

int main() {
    double value{0};
    double next_oper;
    char operation;
    cout << "\nEnter an arithmetic expression followed by |:";
    bool not_done = true;
    cin >> value;
    while(not_done) {
        cin >> operation;
        switch(operation) {
        case '+' :
            cin >> next_oper;
            value += next_oper;
            break;
        case '-' :
            cin >> next_oper;
            value -= next_oper;
            break;
        case '*' :
            cin >> next_oper;
            value *= next_oper;
            break;
        case '/' :
            cin >> next_oper;
            value /= next_oper;
            break;
        case '|' :
            not_done = false;
            break;
        default :
            error("I don't know what to do.");
        }
    }
    cout << "\nThe value is " << value;
}
